﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Models="clr-namespace:MSDNWebcast.Models"
    xmlns:Controls="clr-namespace:MSDNWebcast.Controls"
    xmlns:Commands="clr-namespace:MSDNWebcast.Commands">

    <SolidColorBrush x:Key="backgroundNormal" Color="Black" Opacity=".3"></SolidColorBrush>

    <SolidColorBrush x:Key="borderColor" Color="Black" Opacity=".15"></SolidColorBrush>

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    <!-- mainTab: TabControl -->

    <Style x:Key="mainTab"  TargetType="{x:Type Controls:AnimatedTabControl}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:AnimatedTabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Rectangle Margin="0,10,0,0" Grid.Row="1" Height="1" HorizontalAlignment="Stretch">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
                                    <GradientStop Color="#B91A61D5" Offset="0"/>
                                    <GradientStop Color="#FF000000" Offset="0.24"/>
                                    <GradientStop Color="#B91A61D5" Offset="0.599"/>
                                    <GradientStop Color="#FF000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Border Name="Border" Grid.Row="2"
                                KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" >
                            <ContentPresenter Name="PART_SelectedContentHost" Margin="0" ContentSource="SelectedContent" RenderTransformOrigin="0.5,0.5">
                                <ContentPresenter.RenderTransform>
                                    <ScaleTransform x:Name="transform"></ScaleTransform>
                                </ContentPresenter.RenderTransform>
                            </ContentPresenter>
                        </Border>
                        <Grid>
                            <Border Name="tabBorder">
                                <StackPanel Margin="280,0,0,0" HorizontalAlignment="Left" Width="400">
                                    <TabPanel Name="HeaderPanel"  Panel.ZIndex="1" IsItemsHost="True"
                                              KeyboardNavigation.TabIndex="1" HorizontalAlignment="Left"/>
                                </StackPanel>
                            </Border>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <EventTrigger RoutedEvent="Controls:AnimatedTabControl.SelectionChanging">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="PART_SelectedContentHost" Storyboard.TargetProperty="Opacity" To="0"/>
                                    <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="PART_SelectedContentHost" Storyboard.TargetProperty="Opacity" To="0"/>
                                    <DoubleAnimation BeginTime="0:0:0.5" Duration="0:0:0.5" Storyboard.TargetName="PART_SelectedContentHost" Storyboard.TargetProperty="Opacity" To="1"/>
                                    <DoubleAnimation BeginTime="0:0:0.5" Duration="0:0:0.5" Storyboard.TargetName="PART_SelectedContentHost" Storyboard.TargetProperty="Opacity" To="1"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- mainTab: TabItem -->

    <Style x:Key="mainTabItem"  TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border Name="Border" Margin="0,0" Padding="12,1" CornerRadius="2" TextBlock.FontSize="14" TextBlock.LineHeight="18"
                                TextBlock.Foreground="White">
                            <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center"
                                              ContentSource="Header" Margin="2" RecognizesAccessKey="True" Opacity=".4">
                            </ContentPresenter>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="ContentSite" Property="Opacity" Value="1" />
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource backgroundNormal}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.25" Storyboard.TargetName="ContentSite" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <!--<ColorAnimation Duration="0:0:0.25" Storyboard.TargetName="Border" Storyboard.TargetProperty="TextBlock.Foreground" To="#79ff25"/>-->
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <!--<ColorAnimation Duration="0:0:0.25" Storyboard.TargetName="Border" Storyboard.TargetProperty="TextBlock.Foreground" To="White"/>-->
                                        <DoubleAnimation Duration="0:0:0.25" Storyboard.TargetName="ContentSite" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="#EEEEEE" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="#AAAAAA" />
                            <Setter Property="Foreground" Value="#888888" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Courses: ListBox -->

    <Style x:Key="courseListBox" TargetType="{x:Type ListBox}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Visible"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">

                    <Border Name="Border">
                        <ScrollViewer Margin="0,0" Focusable="false" HorizontalAlignment="Stretch">
                            <StackPanel Margin="10,0,10,0"  IsItemsHost="True" />
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="#EEEEEE" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="#AAAAAA" />
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--课程下载文件-->

    <ControlTemplate x:Key="FileButtonTemplate" TargetType="{x:Type Button}">
        <Border Name="Border" Margin="5,0" CornerRadius="3" TextBlock.Foreground="#d2d8de" TextBlock.FontSize="13" TextBlock.FontWeight="Bold"
                      TextBlock.FontFamily="微软雅黑" TextBlock.LineHeight="18" Background="{StaticResource backgroundNormal}">
            <Grid Name="grid" Opacity=".6">
                <ContentPresenter Margin="15,1,25,1"  VerticalAlignment="Center" HorizontalAlignment="Center" />
                <Image Name="download" Visibility="Collapsed" Margin="5,4" HorizontalAlignment="Right"
                       Source="..\Images\Download.png" Height="12" Width="12"  VerticalAlignment="Bottom"  >
                    <Image.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Image.RenderTransform>
                </Image>
                <Image Name="loading" Margin="5,4" HorizontalAlignment="Right" Visibility="Collapsed" 
                       Source="..\Images\loading.png" Height="12" Width="12" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5">
                    <Image.Triggers>
                        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                            <BeginStoryboard>
                                <Storyboard RepeatBehavior="Forever">
                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        <SplineDoubleKeyFrame KeyTime="00:00:01" Value="360"/>
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </Image.Triggers>
                    <Image.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Image.RenderTransform>
                </Image>
                <Image Name="openFile" Visibility="Collapsed" Margin="5,4" HorizontalAlignment="Right"
                       Source="..\Images\folder.png" Height="12" Width="12"  VerticalAlignment="Bottom"></Image>
                <Image Name="playVideo" Visibility="Collapsed" Margin="5,4" HorizontalAlignment="Right"
                       Source="..\Images\play.png" Height="12" Width="12"  VerticalAlignment="Bottom"></Image>
                <Rectangle Name="underLine" Opacity="0"  Margin="15,0,5,2" Height="1" Fill="#d2d8de" VerticalAlignment="Bottom"></Rectangle>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=State}">
                <DataTrigger.Value>
                    <Models:DownloadState>NotStarted</Models:DownloadState>
                </DataTrigger.Value>
                <DataTrigger.Setters>
                    <Setter Property="Visibility" Value="Visible" TargetName="download" />
                </DataTrigger.Setters>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=IsProcessing}" Value="True">
                <DataTrigger.Setters>
                    <Setter Property="Visibility" Value="Visible" TargetName="loading" />
                </DataTrigger.Setters>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=CanOpen}" Value="True">
                <DataTrigger.Setters>
                    <Setter Property="Visibility" Value="Visible" TargetName="openFile" />
                </DataTrigger.Setters>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=CanPlay}" Value="True">
                <DataTrigger.Setters>
                    <Setter Property="Visibility" Value="Visible" TargetName="playVideo" />
                </DataTrigger.Setters>
            </DataTrigger>

            <Trigger Property="IsPressed" Value="True">
                <Setter TargetName="grid" Property="Opacity" Value="1" />
                <Setter TargetName="Border" Property="TextBlock.Foreground" Value="White" />
            </Trigger>

            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver" Value="True"></Condition>
                    <Condition SourceName="download" Property="Visibility" Value="Visible"></Condition>
                </MultiTrigger.Conditions>
                <MultiTrigger.EnterActions>
                    <BeginStoryboard Name="downloadAnimation">
                        <Storyboard RepeatBehavior="Forever">
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="download" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="-4"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:00.15" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </MultiTrigger.EnterActions>
            </MultiTrigger>

            <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="Border">
                <EventTrigger.Actions>
                    <StopStoryboard BeginStoryboardName="downloadAnimation"></StopStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>

            <Trigger Property="IsMouseOver" Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0.25" Storyboard.TargetName="underLine" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0.25" Storyboard.TargetName="underLine" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.ExitActions>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!--课程文件-->

    <DataTemplate x:Key="itemTemplate">
        <Button Cursor="Hand" Content="{Binding TypeName}" Command="{Binding Path=Command}" 
                Template="{StaticResource FileButtonTemplate}"></Button>
    </DataTemplate>
    <ControlTemplate x:Key="controlTemplate" TargetType="{x:Type ItemsControl}">
        <WrapPanel IsItemsHost="True" Orientation="Horizontal"/>
    </ControlTemplate>

    <!-- Course: ListBoxItem -->

    <Style x:Key="courseItem" TargetType="{x:Type ListBoxItem}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Border Name="Border" SnapsToDevicePixels="true">
                        <Grid Margin="10,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="100"></ColumnDefinition>
                                <ColumnDefinition></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                            </Grid.RowDefinitions>

                            <TextBlock Width="100" Margin="0,5,0,0" DockPanel.Dock="Left" FontSize="13" Text="{Binding Path = Date}"
                                VerticalAlignment="Top" Foreground="#8a959e" FontFamily="微软雅黑" LineHeight="22" />

                            <StackPanel Grid.Column="1"  Margin="5,0" HorizontalAlignment="Stretch">
                                <TextBlock Margin="8,0,0,2" Text="{Binding Path = Headline}" FontSize="18" FontStretch="UltraExpanded"
                                    VerticalAlignment="Bottom" Foreground="White" FontFamily="微软雅黑" TextWrapping="Wrap" LineHeight="28" >
                                    <Image Margin="6,0,0,0" Source="..\Images\speaker.png" Height="12" Width="12" VerticalAlignment="Top"  ToolTip="{Binding Path = Speaker}" />
                                    <!--<Image Source="Images\archive_on.png" Height="12" Width="12" VerticalAlignment="Top" 
                                           ToolTip="{Binding Path = Date}" />-->
                                </TextBlock>
                                <TextBlock Margin="8,0,0,12" FontSize="13" FontStretch="UltraExpanded"
                                                     VerticalAlignment="Bottom" Foreground="#8a959e" FontFamily="微软雅黑" TextWrapping="Wrap" LineHeight="22" Text="{Binding Path = Series}">
                                </TextBlock>
                            </StackPanel>

                            <StackPanel Grid.Row="1" Grid.Column="1" Margin="5,0" HorizontalAlignment="Stretch">
                                <TextBlock  Margin="8,0" Language="zh-cn" FontSize="13"  Grid.Row="1" LineHeight="22" FontStretch="UltraExpanded"
                                                 VerticalAlignment="Bottom" FontStyle="Normal" Foreground="#8a959e" TextWrapping="Wrap"  Text="{Binding Path = Description}">
                                        <Run Text=" "/>
                                        <Hyperlink Foreground="#d2d8de" NavigateUri="{Binding Path = Url}" Command="Commands:GlobalCommands.OpenUrl" CommandParameter="{Binding Path = Url}">详细
                                            <Image Source="..\Images\external_link.png" Height="12" Width="12" Opacity=".75" VerticalAlignment="Top"  />
                                        </Hyperlink>
                                </TextBlock>
                                <DockPanel>
                                    <TextBlock Margin="8,11,0,11" DockPanel.Dock="Left" Visibility="{Binding Path=HasFiles, Converter ={StaticResource BooleanToVisibilityConverter}}"
                                                   Foreground="#8a959e" FontSize="13" Text="课件下载："
                                                   FontFamily="微软雅黑" TextWrapping="Wrap" LineHeight="18"/>
                                    <TextBlock Margin="8,11,0,11" DockPanel.Dock="Left" Visibility="{Binding Path=ShowNoFilesInfo, Converter ={StaticResource BooleanToVisibilityConverter}}"
                                                   Foreground="#8a959e" FontSize="13" Text="暂无课件下载"
                                                   FontFamily="微软雅黑" TextWrapping="Wrap" LineHeight="18"/>
                                    <ItemsControl Margin="0,10" ItemsSource="{Binding Path=CourseFiles}" 
                                                  ItemTemplate="{StaticResource itemTemplate}"
                                                  Template="{StaticResource controlTemplate}">
                                    </ItemsControl>
                                </DockPanel>
                            </StackPanel>

                            <Rectangle Grid.ColumnSpan="2" Margin="0,10,0,10" Grid.Row="2" Height="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" SnapsToDevicePixels="True">
                            </Rectangle>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- CatalogCourse: ListBox -->

    <Style x:Key="courseCatalogListBox" TargetType="{x:Type ListBox}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Visible"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">

                    <Border Name="Border">
                        <ScrollViewer Margin="0,0" Focusable="false" HorizontalAlignment="Stretch">
                            <StackPanel  IsItemsHost="True" />
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="#EEEEEE" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="#AAAAAA" />
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- CatalogCourse: ListBoxItem -->

    <Style x:Key="courseCatalogItem" TargetType="{x:Type ListBoxItem}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Border Name="Border" SnapsToDevicePixels="true">
                        <TextBlock Margin="6,0" Name="textBlock" FontSize="13" Text="{Binding Path = Name}" HorizontalAlignment="Stretch" TextWrapping="NoWrap" TextTrimming="WordEllipsis"
                                VerticalAlignment="Center" FontFamily="微软雅黑" LineHeight="24">
                             <TextBlock.Foreground>
                                 <SolidColorBrush x:Name="MySolidColorBrush" Color="#8a959e" />
                             </TextBlock.Foreground>
                        </TextBlock>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Foreground" Value="White" TargetName="textBlock"/>
                        </Trigger>

                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="MySolidColorBrush" Storyboard.TargetProperty="Color">
                                            <LinearColorKeyFrame Value="White" KeyTime="00:00:0.15" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="MySolidColorBrush" Storyboard.TargetProperty="Color">
                                            <LinearColorKeyFrame Value="#8a959e" KeyTime="00:00:0.15" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ControlStyles: CheckBox -->

    <Style x:Key="{x:Type CheckBox}" TargetType="{x:Type CheckBox}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Grid Margin="5,0" Height="30" TextBlock.FontFamily="微软雅黑" TextBlock.FontSize="13"
                           TextBlock.FontStretch="UltraExpanded">
                        <ContentPresenter Margin="5,0" VerticalAlignment="Center"
                                          HorizontalAlignment="Center" RecognizesAccessKey="True">
                            <ContentPresenter.BitmapEffect>
                                <OuterGlowBitmapEffect GlowColor="White" GlowSize="10" Opacity="0.65"></OuterGlowBitmapEffect>
                            </ContentPresenter.BitmapEffect>
                        </ContentPresenter>
                        <Ellipse VerticalAlignment="Bottom" Margin="0,0,0,-10" Name="CheckMark" Width="20" Height="20" >
                            <Ellipse.Clip>
                                <RectangleGeometry>
                                    <RectangleGeometry.Rect>
                                        <Rect Height="10" Width="20" X="0" Y="0"></Rect>
                                    </RectangleGeometry.Rect>
                                </RectangleGeometry>
                            </Ellipse.Clip>
                            <Ellipse.Fill>
                                <RadialGradientBrush>
                                    <GradientStop Offset="0" Color="White" />
                                    <GradientStop Offset="1" Color="Transparent" />
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Visible" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- SimpleStyles: TabControl -->

    <Style  TargetType="{x:Type TabControl}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="260"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border Name="Border"  Grid.Column="1" CornerRadius="0,8,8,8" Background="{StaticResource backgroundNormal}" 
                                KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" >
                            <ContentPresenter Name="PART_SelectedContentHost" Margin="0" ContentSource="SelectedContent" />
                        </Border>
                        <TabPanel Name="HeaderPanel" IsItemsHost="True" VerticalAlignment="Top" 
                                  KeyboardNavigation.TabIndex="1" HorizontalAlignment="Stretch">
                        </TabPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- SimpleStyles: TabItem -->

    <Style TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Border Name="Border" CornerRadius="8,0,0,8" Margin="0,0,0,6"  >
                        <ContentPresenter x:Name="ContentSite" Opacity=".3" Margin="0,8" VerticalAlignment="Top" HorizontalAlignment="Center"
                                              ContentSource="Header" RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="-1" />
                            <Setter TargetName="ContentSite" Property="Opacity" Value="1" />
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource backgroundNormal}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.25" Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.25" Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="#EEEEEE" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="#AAAAAA" />
                            <Setter Property="Foreground" Value="#888888" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>